<%@ page import="com.zjm.jsp.pojo.Student" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: ZJM
  Date: 2024/4/17
  Time: 22:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>Title</title>
  <style>
      table {
          border: 1px solid #000;
          border-collapse: collapse;
      }

      table tr td, table th td {
          border: 1px solid #000;
      }
  </style>
</head>
<body>
<%
  // List<Student> studentList = new ArrayList<>();
  // for (int i = 0; i < 10; i++) {
  //   studentList.add(new Student(i + 1, "name" + i, 18 + i, "phone" + i));
  // }
  List<Student> studentList = (List<Student>) request.getAttribute("studentList");
%>

<table>
  <tr>
  <td>id</td>
  <td>姓名</td>
  <td>年龄</td>
  <td>手机号</td>
  </tr>
  <% for (Student student : studentList) {%>
  <tr>
    <td><%=student.getId()%>
    </td>
    <td><%=student.getName()%>
    </td>
    <td><%=student.getAge()%>
    </td>
    <td><%=student.getPhone()%>
    </td>
  </tr>
  <%}%>
</table>
</body>
</html>
